import { axios } from '@/utils/request'

export function shopgoodsinfofetchList(query) {
  return axios({
    url: '/yjsh/shopgoodsinfo/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return axios({
    url: '/yjsh/shopgoodsinfo',
    method: 'post',
    data: obj
  })
}

export function getObj(query) {
  return axios({
    url: '/yjsh/shopgoodsinfo/pageByShopId',
    method: 'get',
    params: query
  })
}

export function delObj(id) {
  return axios({
    url: '/yjsh/shopgoodsinfo/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return axios({
    url: '/yjsh/shopgoodsinfo',
    method: 'put',
    data: obj
  })
}

export function changeShelf(obj) {  //上下架
  return axios({
    url: '/yjsh/shopgoodsinfo/changeShelf',
    method: 'put',
    data: obj
  })
}



export function goodstockfetchList(query) {  //库存单位
  return axios({
    url: '/yjsh/goodstock/page',
    method: 'get',
    params: query
  })
}


export function goodstockfetchListAll(query) {  //库存单位
  return axios({
    url: '/yjsh/goodstock/getGoodstockList',
    method: 'get',
    params: query
  })
}

export function shopgoodscategory(obj) {  //门店商品类目
  return axios({
    url: '/yjsh/shopgoodscategory/tree',
    method: 'post',
    data: obj
  })
}
export function platformgoodscategory(obj) {  //平台商品类目
  return axios({
    url: '/yjsh/platformgoodscategory/tree',
    method: 'get',
    params: obj
  })
}


export function goodstype(query) {  //商品类型
  return axios({
    url: '/yjsh/goodstype/page',
    method: 'get',
    params: query
  })
}

export function getTpyeId(TpyeId) {  //商品类型
  return axios({
    url: '/yjsh/goodstype/updateGoodsType/' + TpyeId,
    method: 'get',
  })
}


export function merchantinfosupply(query) {  //供应商分页查询
  return axios({
    url: '/yjsh/merchantinfo/supply/page',
    method: 'get',
    params: query
  })
}

export function shopgoodsinfodetail(id) {  //编辑商品详情
  return axios({
    url: '/yjsh/shopgoodsinfo/detail/' + id,
    method: 'get',
  })
}

export function getShopBusiness(query) {  //根据deptId查询门店信息
  return axios({
    url: '/yjsh/shopinfo/getShopBusiness',
    method: 'get',
    params: query
  })
}

